package 剑指offer.zw_17_打印从1到最大的n位数;

class Solution {
    public static void main(String[] args) {
        int n = 3;
        int[] numbers = printNumbers(n);
        for (int number : numbers) {
            System.out.print(number + " ");
        }
    }

    public static int[] printNumbers(int n) {
        int end = (int) Math.pow(10, n) - 1;
        int[] res = new int[end];
        for (int i = 0; i < end; i++)
            res[i] = i + 1;
        return res;
    }
}
